#元组 tuple 不可变序列（有序的）
# tuple1=() #定义空元组
# print(tuple1)
# tuple2=(1,2,3,4,5)
# print(tuple2)
# tuple3=1,2,3,4,5 #元组括号可以省略，但是不建议
# print(tuple3)
# print(type(tuple3))
# tup=(1,3.14,False,[1,2,3],'hello')
# print(tup)
#tuple()函数使用
# list1=['hello','world',1,2,3]
# str='hello world'
# tup01=tuple(list1)
# print(tup01)#list--->tuple
# # print(tuple(str))#str--->tuple
# print(tup01[1])
# print(tup01[10])

#tuple01=(1,3,2,1,2,3,5,6,3,4,2)
#tuple01[1]=30 #不允许直接赋值
# print(tuple01)
# print(len(tuple01)) #len() 元组中元素个数
# print(tuple01.count(1))#count() 统计某个元素在元组出现的次数
# print(tuple01.index(3)) #找出某个元素在元组出现的位置索引下标
# print(tuple01.index(3,2,4))#指定元组数据范围内去查找,找不到会出现错误
# print(id(tuple01))#id()内存地址标识
# tuple01=('hello ','world','1',2,3)
# print(tuple01)
# print(id(tuple01))

# tup1=(1,2,3)
# print(id(tup1))
# tup2=(4,5,6)
# print(id(tup2))
# tup=tup1+tup2 #通过“+”实现2个元组拼接
# print(tup)
# print(id(tup))
# list=[]
# tuple01=(1,3,2,1,2,3,5,6,3,4,2,[1,2,3,4])
# print(tuple01.count(100))
# print(tuple01.index(100))
#del tuple01  #删除元组
#print(tuple01)

tup1=(1,2,3)
# print(tup1)
# list2=list(tup1)#tuple--->list
# print(list2)
# list2[1]=20#修改list
# print(list2)
# print(tuple(list2))#list---->tuple
# tup1=(1,20,3)
# del tup1
list =[1,3.14,True,'hello',[1,2,3],(1,2,3),{'hh','dd'},{'name': 'Tom'}]
print(type(list))
print(list)
tuple=(1,3.14,True,'hello',[1,2,3],(1,2,3),{'hh','dd'},{'name': 'Tom'})
print(type(tuple))
print(tuple)
set={1,0,3.14,True,False,'hello','hello','hello',1,1,1,(1,2,3)}
print(type(set))
print(set)

